Skip to content

Conversation

@tomtor
Copy link
Contributor

@tomtor tomtor commented Jun 29, 2025

Fix the only compile time warning for AVR (default flags):

/home/tom/src/rust/llvm-project/llvm/lib/Target/AVR/MCTargetDesc/AVRInstPrinter.cpp: In member function ‘void
 llvm::AVRInstPrinter::printOperand(const llvm::MCInst*, unsigned int, llvm::raw_ostream&)’:
/home/tom/src/rust/llvm-project/llvm/lib/Target/AVR/MCTargetDesc/AVRInstPrinter.cpp:104:24: warning: possibly
 dangling reference to a temporary [-Wdangling-reference]
  104 |   const MCOperandInfo &MOI = this->MII.get(MI->getOpcode()).operands()[OpNo];
      |                        ^~~
/home/tom/src/rust/llvm-project/llvm/lib/Target/AVR/MCTargetDesc/AVRInstPrinter.cpp:104:76: note: the tempora
ry was destroyed at the end of the full expression ‘(&(&((llvm::AVRInstPrinter*)this)->llvm::AVRInstPrinter::
<anonymous>.llvm::MCInstPrinter::MII)->llvm::MCInstrInfo::get(MI->llvm::MCInst::getOpcode()))->llvm::MCInstrD
esc::operands().llvm::ArrayRef<llvm::MCOperandInfo>::operator[](((size_t)OpNo))’
  104 |   const MCOperandInfo &MOI = this->MII.get(MI->getOpcode()).operands()[OpNo];
      |                                                                            ^

@tomtor tomtor closed this Jun 29, 2025
@tomtor
Copy link
Contributor Author

tomtor commented Jun 29, 2025

Look at this at a later time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant